package com.ddyx.rest;

import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ddyx.service.IWxClientGoodService;
import com.ddyx.service.IWxCustomerService;
import com.ddyx.service.IWxFootprintService;
import com.ddyx.service.IWxSubInfoService;
import com.ddyx.util.RequestForm;
import com.ddyx.util.ResponseForm;

@Controller
@RequestMapping("/wx")
public class WxClientController {
	
	@Resource
	IWxClientGoodService iWxClientGoodService;
	
	@Resource
	IWxCustomerService iWxCustomerService;
	
	@Resource
	IWxFootprintService iWxFootprintService;
	
	@Resource
	IWxSubInfoService iWxSubInfoService;
	
	
	/**
	 * 获取商品列表
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/selectwxGood", method = RequestMethod.POST)
	public ResponseForm selectwxGood(@RequestBody RequestForm requestForm) {
		return iWxClientGoodService.selectwxGood(requestForm);
	}
	/**
	 * 添加商品接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/insertwxGood", method = RequestMethod.POST)
	public ResponseForm insertwxGood(@RequestBody RequestForm requestForm) {
		return iWxClientGoodService.insertwxGood(requestForm);
	}
	
	/**
	 * 根据商品id 查询商品详情列表接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/selectwxGoodInfoById", method = RequestMethod.POST)
	public ResponseForm selectwxGoodInfoById(@RequestBody RequestForm requestForm) {
		return iWxClientGoodService.selectwxGoodInfoById(requestForm);
	}
	
	/**
	 * 创建微信客户接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/createWxCustomer", method = RequestMethod.POST)
	public ResponseForm createWxCustomer(@RequestBody RequestForm requestForm) {
		return iWxCustomerService.createWxCustomer(requestForm);
	}
	
	/**
	 * 加入客户足迹接口
	 * 点赞/取消点赞
	 * 收藏/取消收藏
	 * 
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/insertwxFootprint", method = RequestMethod.POST)
	public ResponseForm insertwxFootprint(@RequestBody RequestForm requestForm) {
		return iWxFootprintService.insertwxFootprint(requestForm);
	}
	
	
	/**
	 * 查询客户足迹接口
	 * 返回收藏列表/返回点赞列表(按时间排序)
	 * 参数:wxUid , actionType ,page , size
	 */
	@ResponseBody
	@RequestMapping(value = "/selectwxFootprintsByUid", method = RequestMethod.POST)
	public ResponseForm selectwxFootprintsByUid(@RequestBody RequestForm requestForm) {
		return iWxFootprintService.selectwxFootprintsByUid(requestForm);
	}
	
	
	/**
	 * 商品预约到店接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/insertSubInfo", method = RequestMethod.POST)
	public ResponseForm insertSubInfo(@RequestBody RequestForm requestForm) {
		return iWxSubInfoService.insertSubInfo(requestForm);
	}
	
	
	/**
	 * 查询商品预约接口
	 */
	@ResponseBody
	@RequestMapping(value = "/selectSubInfo", method = RequestMethod.POST)
	public ResponseForm selectSubInfo(@RequestBody RequestForm requestForm) {
		return iWxSubInfoService.selectSubInfo(requestForm);
	}
	
	/**
	 * 通过wxUid查询商品预约列表接口
	 * 返回预约商品列表(按时间排序)
	 * 参数: wxUid ,page ,size
	 */
	@ResponseBody
	@RequestMapping(value = "/selectSubInfoByWxUid", method = RequestMethod.POST)
	public ResponseForm selectSubInfoByWxUid(@RequestBody RequestForm requestForm) {
		return iWxSubInfoService.selectSubInfoByWxUid(requestForm);
	}
	
	/**
	 * 取消商品预约接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/cancelSubInfo",method = RequestMethod.POST)
	public ResponseForm cancelSubInfo(@RequestBody RequestForm requestForm){
		return iWxSubInfoService.cancelSubInfo(requestForm);
	}
	
	/**
	 * 修改预约到店信息
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="/updateSubInfo",method = RequestMethod.POST)
	public ResponseForm updateSubInfo(@RequestBody RequestForm requestForm){
		return iWxSubInfoService.updateSubInfo(requestForm);
	}
	
	
	
}
